package Fourth;

public class SingleQues extends Question{
	char answer;
	public SingleQues(String title, String[] choices,char answer) {
		super(title, choices);
		this.answer=answer;
	}
	//判断是否选对
	public boolean check(String answer) {
		if(answer.compareTo("")==0) {//如果直接按回车(没选选项)
			return false;
		}
		char answerchar=answer.charAt(0);
		if(this.answer==answerchar) {
			return true;
		}
		else {
			return false;
		}
	}
	public String toString() {
		String result=title+"\n";
		for(String i:this.choices) {
			result+=i+"\t";
		}
		result+="\n";
		result+="Please choose:";
		return result;
	}
	
	
	
}
